// 用户系统样式
export default {
  namespaced: true,
  state: {
    // 动态菜单路由
    dynamicMenuRoutes: [],
    // 权限
    permissions: [],
    // 页面文档可视高度(随窗口改变大小)
    documentClientHeight: 0,
    // 主内容可视高度(随窗口改变大小)
    mainContentHeight: 0,
    // 导航条, 布局风格, defalut(默认) / inverse(反向)
    navbarLayoutType: 'inverse',
    // 侧边栏, 布局皮肤, light(浅色) / dark(黑色)
    sidebarLayoutSkin: 'light',
    // 侧边栏, 折叠状态
    sidebarFold: false,
    // 侧边栏, 菜单
    menus: [],
    // 侧边栏默认打开菜单名称
    menuActiveName: '',
    // 主入口标签页
    mainTabs: [],
    // 主入口标签页默认打开的标签名
    mainTabsActiveName: '',
    // 清除菜单选中
    menuClear: false
  },
  mutations: {
    SET_DYNAMICMENUROUTES (state, dynamicMenuRoutes) {
      state.dynamicMenuRoutes = dynamicMenuRoutes
    },
    SET_PERMISSIONS (state, permissions) {
      state.permissions = permissions
    },
    SET_DOCUMENTCLIENTHEIGHT (state, height) {
      state.documentClientHeight = height
    },
    SET_MAINCONTENTHEIGHT (state, height) {
      state.mainContentHeight = height
    },
    SET_NAVBARLAYOUTTYPE (state, type) {
      state.navbarLayoutType = type
    },
    SET_SIDEBARLAYOUTSKIN (state, skin) {
      state.sidebarLayoutSkin = skin
    },
    SET_SIDEBARFOLD (state, fold) {
      state.sidebarFold = fold
    },
    SET_MENUS (state, menus) {
      state.menus = menus
    },
    SET_MENUACTIVENAME (state, name) {
      state.menuActiveName = name
    },
    SET_MAINTABS (state, tabs) {
      state.mainTabs = tabs
    },
    SET_MAINTABSACTIVENAME (state, name) {
      state.mainTabsActiveName = name
    },
    SET_MENUCLEAR (state, menuClear) {
      state.menuClear = menuClear
    }
  },
  actions: {
    DynamicMenuRoutes({ commit }, dynamicMenuRoutes) {
      commit('SET_DYNAMICMENUROUTES', dynamicMenuRoutes)
    },
    DocumentClientHeight({ commit }, height) {
      commit('SET_DOCUMENTCLIENTHEIGHT', height)
    },
    UpdateMainTabs({ commit }, tabs) {
      commit('SET_MAINTABS', tabs)
    }
  }
}
